<?php
/**
 * GioCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@ninhgio.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2010-2011 GioCMS (http://cms.ninhgio.com)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @author		NinhGio - ninhgio@gmail.com
 * @since		1.0
 */
?>
<div id="g_a_file_browser">
	<div class="g_a_box_content g_a_file_browser" id="gUploadFileToolbox"></div>
</div>
<script type="text/javascript">
'Gio.Upload.Widgets.FileToolbox'.namespace();
Gio.Upload.Widgets.FileToolbox.loadWidgets = function(path, page, style) {
	var data      = $.toJSON({
						path: path,
						page: page,
						style: style
					});
	$('#gUploadFileToolbox').addClass('g_a_ui_helper_loading').css('opacity', '0.75');
	Gio.Core.Widget.Loader.queueAction('upload', 'filetoolbox', 'load', data, $('#gUploadFileToolbox'), function(response) {
		$('#gUploadFileToolbox').removeClass('g_a_ui_helper_loading').css('opacity', '1');
		$('#gUploadFileToolbox').html(response);
		$('.g_upload_browsetoolbox_draggable').draggable({
			cursor: 'crosshair',
			iframeFix: true,
			helper: 'clone'
		});
	});
};

$(document).ready(function() {
	Gio.Upload.Widgets.FileToolbox.loadWidgets('<?php echo $this->path?>', 1, 'list');
});
</script>
